package com.java.task20.work1;

public class WorkersTest {
    public static void main(String[] args) {
        Workers w1 = new Workers("zhangfei", 30);
        System.out.println(w1);
        //w1.setName("");
        w1.setName("guanyu");
        try {
            w1.setAge(-30);     //如果过有异常则捕捉
        } catch (AgeException e) {
            e.printStackTrace();
        }
        System.out.println(w1);
    }
}
